package org.duang.common.dto;

import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.duang.config.Config;
import org.duang.kit.ToolsKit;

public class DRLDto {
	
	private String clientIp;//客户端IP
	private Date requestTime;	//请求时间
	private String method;//请求方式
	private String uri;					//请求URI
	private String protocol;			//协议
	private String params;			//请求参数
	private String result;				//返回结果
	private long useTime;			//用时
	private String header;			//请求头
	private List<Map<String, String>> linkList = new ArrayList<Map<String,String>>();  //controller service  dao层的请求链路
	private boolean isException;
	
	public DRLDto() {
		super();
	}
	public DRLDto(String clientIp, Date requestTime, String method, String uri, String protocol, String params,
			String result, long useTime, String header, List<Map<String, String>> linkList, boolean isException) {
		super();
		this.clientIp = clientIp;
		this.requestTime = requestTime;
		this.method = method;
		this.uri = uri;
		this.protocol = protocol;
		this.params = params;
		this.result = result;
		this.useTime = useTime;
		this.header = header;
		this.linkList = linkList;
		this.isException = isException;
	}
	public String getClientIp() {
		return clientIp;
	}
	public void setClientIp(String clientIp) {
		this.clientIp = clientIp;
	}
	public Date getRequestTime() {
		return requestTime;
	}
	public void setRequestTime(Date requestTime) {
		this.requestTime = requestTime;
	}
	public String getMethod() {
		return method;
	}
	public void setMethod(String method) {
		this.method = method;
	}
	public String getUri() {
		return uri;
	}
	public void setUri(String uri) {
		this.uri = uri;
	}
	public String getProtocol() {
		return protocol;
	}
	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}
	public String getParams() {
		return params;
	}
	public void setParams(String params) {
		this.params = params;
	}
	public String getResult() {
		return result;
	}
	public void setResult(String result) {
		this.result = result;
	}
	public long getUseTime() {
		return useTime;
	}
	public void setUseTime(long useTime) {
		this.useTime = useTime;
	}
	public String getHeader() {
		return header;
	}
	public void setHeader(String header) {
		this.header = header;
	}

	public boolean isException() {
		return isException;
	}
	public void setException(boolean isException) {
		this.isException = isException;
	}
	@Override
	public String toString() {
		return "DRLDto [clientIp=" + clientIp + ", requestTime=" + ToolsKit.formatDate(requestTime, Config.getDefaultDateFormat()) + ", method=" + method + ", uri=" + uri
				+ ", protocol=" + protocol + ", params=" + params + ", result=" + result + ", useTime=" + useTime
				+ ", header=" + header + ", linkList=" + linkList + ", isException=" + isException + "]";
	}
	public List<Map<String, String>> getLinkList() {
		return linkList;
	}
	public void setLinkList(List<Map<String, String>> linkList) {
		this.linkList = linkList;
	}
}
